New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add partialsDir.rename option #151
Conversation
We need more flexibility when it comes to naming partials and don't want to be constrained by our folder structure. For example, we have /components /button button.hbs /template otherTemplate.hbs Currently, this names the partial button/button and template/otherTemplate. This renaming function allows more flexibility, e.g., naming the two templates button and otherTemplate, ignoring the folder structure.
Why are those not good names? Is there a reason you need "better" names? |
Continuing the example above, we want to have the template next to other files, e.g. a JS or CSS file organized in subfolders in components. So, next to button.hbs there could be button.js, button.css. Without the renaming function, the partial's name would be 'button/button' which is redundant and doesn't work with our implementation. Without the renaming feature, we'd have to keep all templates in one partials dir. |
why doesn't it work with your implementation? Why is is being redundant a bad thing? It shows the path to the partial so it is easy to find. I'm trying to understand if this is a "need" or a "want". Or if there is a better way to accomplish the "want". This doesn't seem like a feature that would be very useful to many users so it would be better if there is a way to handle it without causing feature creep |
I understand your concern. I try to explain why we want/need it and you can decide if it potentially helps others or if it qualifies as feature creep. We're using things like Renaming the partial would be the most elegant solution for us. But sure, there are workarounds, mapping the Again, if you deem this unnecessary feel free to ignore this PR. |
Do you have a workaround that currently works? |
Well, yes, not organize handlebar files/partials in component folders but one single partial folder. Not ideal but it's ok. |
# [5.3.0](v5.2.1...v5.3.0) (2021-03-30) ### Features * Add partialsDir.rename option ([#151](#151)) ([1a6771b](1a6771b))
🎉 This PR is included in version 5.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks for this! Sorry it took me so long to review. |
Thank you, I appreciate it! |
We need more flexibility when it comes to naming partials and don't want to be constrained by our folder structure.
For example, we have
Currently, this names the partial button/button and template/otherTemplate.
This renaming function allows more flexibility, e.g., naming the two templates button and otherTemplate, ignoring the folder structure.